package com.xypw.models;



import com.et.ar.ActiveRecordBase;
import com.et.ar.annotations.Column;
import com.et.ar.annotations.Id;
import com.et.ar.annotations.Table;

@Table(name="tb_publishInfoCounter")
public class PublishInfoCounter extends ActiveRecordBase{
	@Id
	private int id;
	@Column
	private String code;
	@Column
	private long total;
	private String totalStr;
	@Column
	private long proInfoTotal;
	private String proInfoTotalStr;
	@Column
	private long creditInfoTotal;
	private String creditInfoTotalStr;
	@Column
	private long columnTotal;
	private String columnTotalStr;
	private boolean showColumnCount;
	@Column
	private String date;
	
	private String appedComma (long num){
		String str = String.valueOf(num);
        int i = str.length();
        while (i > 3) {
            str = str.substring(0, i - 3) + "," + str.substring(i - 3);
            i -= 3;
        }
        return str;
	}
	
	public void formatNum(){
		 setTotalStr(appedComma(total));
		 setProInfoTotalStr(appedComma(proInfoTotal));
		 setCreditInfoTotalStr(appedComma(creditInfoTotal));
		 setColumnTotalStr(appedComma(columnTotal));
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public String getTotalStr() {
		return totalStr;
	}

	public void setTotalStr(String totalStr) {
		this.totalStr = totalStr;
	}

	public long getProInfoTotal() {
		return proInfoTotal;
	}

	public void setProInfoTotal(long proInfoTotal) {
		this.proInfoTotal = proInfoTotal;
	}

	public String getProInfoTotalStr() {
		return proInfoTotalStr;
	}

	public void setProInfoTotalStr(String proInfoTotalStr) {
		this.proInfoTotalStr = proInfoTotalStr;
	}

	public long getCreditInfoTotal() {
		return creditInfoTotal;
	}

	public void setCreditInfoTotal(long creditInfoTotal) {
		this.creditInfoTotal = creditInfoTotal;
	}

	public String getCreditInfoTotalStr() {
		return creditInfoTotalStr;
	}

	public void setCreditInfoTotalStr(String creditInfoTotalStr) {
		this.creditInfoTotalStr = creditInfoTotalStr;
	}

	public long getColumnTotal() {
		return columnTotal;
	}

	public void setColumnTotal(long columnTotal) {
		this.columnTotal = columnTotal;
	}

	public String getColumnTotalStr() {
		return columnTotalStr;
	}

	public void setColumnTotalStr(String columnTotalStr) {
		this.columnTotalStr = columnTotalStr;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public void setShowColumnCount(boolean showColumnCount) {
		this.showColumnCount = showColumnCount;
	}

	public boolean isShowColumnCount() {
		return showColumnCount;
	}

	
}
